﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;
using System.IO;
using CMD_WEB.FileServer;

namespace CMD_WEB.Services
{
    [ServiceContract]
    public interface IAuth
    {
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.AUTH.Rol> GetDataListRolCheck(string aIdGroup);

        //servicio para obtener la Auntentificacion GRUPO_USUARIO
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD_WEB.BAL.JSONOBJ.UserInfo GetGruposUsuario();

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.AUTH.AuthUserRol GetUserRolListRol(string idRol);

        //Servicio para obtener la lista de roles
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.AUTH.Rol GetDataRol(string aIdRol);
        //Servicio para obtener la lista de ROLES solo el id y el descriptor
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.AUTH.Rol> GetDataListRol(string aIdRol);
        //servico para obtener la lista de grupos
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.AUTH.Group> GetDataListGroup(string aIdGroup);
        //servicio para obtener un grupo
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.AUTH.Group GetDataGroup(string aIdGroup);
        //servicio para agregar un Grupo  mediante un rol
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string AddGroup(int idGroup, string parametrosRol);
        //servicio para agregar o acualizar un Rol 
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.MISC.UpsertStateMsg UpsertRol(string idRol, int prio, string rol);
        //servicio para agregar o actualizar un grupo
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.MISC.UpsertStateMsg UpsertGroup(string groupName, string groupMail, int idGroup,string idRol,string dscRol);
        //servicio para eliminar Roles
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.MISC.DeleteStateMsg DeleteRol(string aIdRol);
        //servicio para eliminar grupos
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.MISC.DeleteStateMsg DeleteGroup(string aIdGroup);
        //servicio para obtener la lista de banco
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.Banco> GetDataBanco();
        
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.CAT.Banco GetDataDscBanco(string idBanco);

        //servicio para obtener la lista de clo
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.Clo> GetDataClo();

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.CAT.Clo GetDataCloCodigo(int idClo);

        //servicio para obtener la lista de territorio
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.EstructuraGeografica> GetDataEstructuraGeografica();

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.CAT.EstructuraGeografica GetDataEstructuraGeograficaTerritorio(string idTerritorio);

        //servicio para obtener la lista de frecuenia
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.Frecuencia> GetDataFrecuencia();
        //servicio para obtener la lista de lead_time
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.LeadTime> GetDataLeadTime();
        //servicio para obtener la lista de Medio_Colocacion
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.MedioColocacion> GetDataMedioColocacion();
        //servicio para obtener la lista de Tipo_Negocio
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.TipoNegocio> GetDataTipoNegocio();
        //servicio para obtener la lista de Tipo_Persona_Fisica
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.TipoPersonaFisica> GetDataTipoPersonaFisica();
        //servicio para obtener la lista de Tipo_Solicitante
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.TipoSolicitante> GetDataTipoSolicitante();
        //servicio para obtener la lista de Zona
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.Zona> GetDataZona();

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.Zona> GetDataIdZone(int idClo);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.CAT.Iva GetDataIva(int idZona);

        //servicio para obtener la lista de Codigo_Postal    
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.Sepomex> GetDataCodigoPostal(string idCodigoPostal, string idColonia);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.CAT.Sepomex> GetDataListLocalidad(string idEstado, string idMunicipio);
        
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
         List<CMD.BAL.CAT.GrupClientes> GetDataGroupClientes();
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.CAT.GrupoPrecios GetDataGroupPrecios(string idTipoNegocio);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.CAT.GrupClientes GetDataGroupClientes4(string idTipoNegocio);
        ////servicio para obtener la lista de Colonia
        //[OperationContract]
        //[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        //List<CMD.BAL.CAT.Sepomex> GetDataListCol(string idCodigoPostal);
        ////servicio para obtener Estado y Colinia
        //[OperationContract]
        //[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        //CMD.BAL.CAT.Sepomex GetDataEstMun(string idCodigoPostal);
        //servicio para obtener IdColonia,Colonia,Estado y Colinia
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.CAT.Sepomex GetDataEstMunCol(string idCodigoPostal);
        //servicio para obtener las Solicitudes(Tipo(Alta,Modificacion,Reemplazo) y Status(Borradores y Aprobadas))
        //[OperationContract]
        //[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        //List<CMD.BAL.SOL.solicitudData> RecuperaTodas(bool todas, int idStatus, int idTipo);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.SOL.solicitudData> RecuperaTodasRol(bool todas, int idStatus, int idTipo, string unidRol);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.SOL.RecuperarSol RefreshCounters(string unidRol);
        //-----------------------
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.MISC.UpsertStateMsg UpdateRolStatus(string unidSolicitud, string unidRol, string pventa, string datsol_isOtrasCategorias, string datsol_isOtrosClientes, int idStatus,/* string docInfo_wUsr, string docInfo_wUsrMail,*/ string datsol_unidTipoSolicitante, int idTipoSolicitud, int datsol_isMismoDomicilio);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.AUTH.VisibilityDiv GetDataDivVisibility(string unidRol);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string GetDataSolicitudWeb(string unidSolicitud, string unidRol);
        //------------------------------------------------
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.SOL.NotificacionesWeb GetDataEmail(string unidSolicitud, int idStatus);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string GetDataSolStatusRol(string unidSolicitud);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string UpsertWeb(string unidSolicitud);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string InsertSolicitudWeb(string unidSolicitud);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.MISC.DeleteStateMsg DeleteSolicitudWeb(string aIdWeb);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.SOL.DocumentosWeb GetDocuments(string idSolicitud);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string InsertDocs(string parametrosDocs);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        int InsertDetalle(string parametrosDetalle);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.SOL.LastReviewDate GetDataFecha();

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string GetDataListObject(string unid_rol);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.SOL.SolicitudDocInfo> GetDataDocInfo(string idSolicitud);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.SOL.ArchivosWeb> GetDataArchivosUpload(string unidSolicitud);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string GetInfoModif(string numCliente);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string GetInfoMessage(string numCliente);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string ServicioSap(string DatosSap);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string RelGroupCorreo(string group);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        void EnviaNotificacion(string email, string unidSolicitud, string msgs, string msgAsunto);



        //--------------------------------------------  inicio SAP
        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        string GetInfoModif_SAP(string numCliente);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        CMD.BAL.MISC.UpsertStateMsg UpdateRolStatus2(string unidSolicitud, string unidRol, string pventa, string datsol_isOtrasCategorias, string datsol_isOtrosClientes, int idStatus,/* string docInfo_wUsr, string docInfo_wUsrMail,*/ string datsol_unidTipoSolicitante, int idTipoSolicitud, int datsol_isMismoDomicilio);

        //--------------------------------------------  fin SAP

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
        List<CMD.BAL.SOL.solicitudData> GetSolicitudesFiltradas(string unidRol, string noCte, string rfc);


    }
}
